//
//  KLBasketTableViewCell.m
//  KunLun
//
//  Created by Mac on 2017/11/27.
//  Copyright © 2017年 stoneobs@icloud.com. All rights reserved.
//

#import "KLBasketTableViewCell.h"
@interface KLBasketTableViewCell()
@property(nonatomic, strong) UIImageView                     *iconImageView;
@property(nonatomic, strong) STLabel                            *titleLable;
@property(nonatomic, strong) STLabel                            *disTanceLable;
@property(nonatomic, strong) STLabel                            *typeLable;
@property(nonatomic, strong) STLabel                            *numLbale;//id
@property(nonatomic, strong) STLabel                            *desLbale;//id
@end
@implementation KLBasketTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self ==[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self configSubView];
    }
    return self;
}
+ (CGFloat)cellHeight{
    return 110;
}
#pragma mark --subView
- (void)configSubView{
    
    self.backgroundColor = [UIColor whiteColor];
    
    self.iconImageView = [[UIImageView alloc] initWithFrame:CGRectMake(15, 5, 100, 100)];
    self.iconImageView.image = [UIImage imageNamed:@"07"];
    [self addSubview:self.iconImageView];
    
    self.titleLable = [[STLabel alloc] initWithFrame:CGRectMake(self.iconImageView.right + 10, self.iconImageView.top + 5, (UIScreenWidth - self.iconImageView.right - 20)/2 - 10, 20)
                                                     text:@"青菜龙家菜"
                                                textColor:KL_firstTextColor
                                                     font:15
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentLeft];
    [self addSubview:self.titleLable];
    
    self.disTanceLable = [[STLabel alloc] initWithFrame:CGRectMake(self.iconImageView.right + 10, self.iconImageView.top + 5, (UIScreenWidth - self.iconImageView.right - 20)/2 , 20)
                                                text:@"距离：0.5km"
                                           textColor:KL_firstTextColor
                                                font:15
                                         isSizetoFit:NO
                                       textAlignment:NSTextAlignmentRight];
    self.disTanceLable.right = UIScreenWidth - 10;
    [self addSubview:self.disTanceLable];
    
    self.typeLable = [[STLabel alloc] initWithFrame:CGRectMake(self.iconImageView.right + 10, self.titleLable.bottom +3, 60, 20)
                                                text:@"菜园子"
                                           textColor:[UIColor whiteColor]
                                                font:14
                                         isSizetoFit:NO
                                       textAlignment:NSTextAlignmentCenter];
    self.typeLable.backgroundColor = KL_BlueBackGroundColor;
    self.typeLable.layer.cornerRadius = 5;
    self.typeLable.clipsToBounds = YES;
    [self addSubview:self.typeLable];
    
    self.numLbale = [[STLabel alloc] initWithFrame:CGRectMake(self.iconImageView.right + 10, self.titleLable.bottom + 3, UIScreenWidth - self.iconImageView.right - 20 - 70, 20)
                                                text:@"商户ID:123456"
                                           textColor:KL_secendTextColor
                                                font:14
                                         isSizetoFit:NO
                                       textAlignment:NSTextAlignmentRight];
    self.numLbale.right = UIScreenWidth - 10;
    [self addSubview:self.numLbale];
    
    self.desLbale = [[STLabel alloc] initWithFrame:CGRectMake(self.iconImageView.right + 10, self.typeLable.bottom, UIScreenWidth - self.iconImageView.right - 20, 60)
                                               text:@"该商铺位于阿卡登记卡上来就打开了手机读卡老实交代私搭乱建的卡萨丁"
                                          textColor:KL_secendTextColor
                                               font:14
                                        isSizetoFit:NO
                                      textAlignment:NSTextAlignmentLeft];
    self.typeLable.numberOfLines = 0;
    [self addSubview:self.desLbale];
}
- (void)setShopModel:(KLShopModel *)shopModel{
    _shopModel = shopModel;
    
    [self.iconImageView sd_setImageWithURL:[NSURL URLWithString:shopModel.head_portrait] placeholderImage:KL_placeHoderImage];
    
    self.titleLable.text = shopModel.shops_name;
    self.disTanceLable.text = [NSString stringWithFormat:@"距离:%@",@"--"];
    self.numLbale.text = [NSString stringWithFormat:@"商户ID:%@",shopModel.shops_ID];
    self.typeLable.text = @"---";
    self.desLbale.text = @"---------------------";
}
@end
